package com.prd.controller;


import com.prd.dto.SysJobDescriptionDTO;
import com.prd.service.SysJobDescriptionService;
import com.prd.util.JsonData;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 岗位说明书 前端控制器
 * </p>
 *
 * @author lizhaoyi
 * @since 2024-01-04
 */
@RestController
@RequestMapping("/api/sysJobDescription")
@Api(tags = "岗位说明书")
public class SysJobDescriptionController {


    @Autowired
    private SysJobDescriptionService sysJobDescriptionService;

    @ApiOperation("添加岗位说明书")
    @PostMapping("add")
    public JsonData add(@RequestBody SysJobDescriptionDTO sysDepartmentLetterDTO){

        return sysJobDescriptionService.add(sysDepartmentLetterDTO);
    }

    @ApiOperation("查看岗位说明书")
    @PostMapping("detail")
    public JsonData detail(@ApiParam("岗位id") @RequestParam Long id){

        return sysJobDescriptionService.detail(id);
    }


    @ApiOperation("查看岗位说明书列表")
    @PostMapping("getAll")
    public JsonData getAll(){

        return sysJobDescriptionService.getAll();
    }

    @ApiOperation("修改岗位说明书")
    @PostMapping("edit")
    public JsonData edit(@RequestBody SysJobDescriptionDTO jobDescriptionDTO){

        return sysJobDescriptionService.edit(jobDescriptionDTO);
    }

}

